package org.mozhu.mboot.core.security;

import java.util.Collection;

public class PermissionUtils {

    public static boolean hasPermission(Collection<String> authorities, String resourcePermission) {
        return authorities.stream().anyMatch(a -> hasPermission(a, resourcePermission));
    }

    public static boolean hasPermission(String authority, String resourcePermission) {
        return authority.equals(resourcePermission);
    }
}
